package ThreadPool.lagou.concurrent.demo02;

/**
 * @param
 * @author oyz
 * @version 1.0.4
 * @description: TODO
 * @date 2022/5/24 22:39
 */
public class Mythread extends Thread {
    @Override
    public void run() {
        while(true){
          boolean flag = isInterrupted();
          System.out.println(flag);
            /*try {
                sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
*/
        }
    }

    public static void main(String[] args) throws InterruptedException {
        Mythread mythread = new Mythread();
        mythread.start();
        Thread.sleep(10);
        mythread.interrupt();
        Thread.sleep(100);
        System.exit(0);
    }
}
